/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  @endpointMap = {
    ap-northeast-1 = 'reidcloud.aliyuncs.com',
    ap-northeast-2-pop = 'reidcloud.aliyuncs.com',
    ap-south-1 = 'reidcloud.aliyuncs.com',
    ap-southeast-1 = 'reidcloud.aliyuncs.com',
    ap-southeast-2 = 'reidcloud.aliyuncs.com',
    ap-southeast-3 = 'reidcloud.aliyuncs.com',
    ap-southeast-5 = 'reidcloud.aliyuncs.com',
    cn-beijing = 'reidcloud.aliyuncs.com',
    cn-beijing-finance-1 = 'reidcloud.aliyuncs.com',
    cn-beijing-finance-pop = 'reidcloud.aliyuncs.com',
    cn-beijing-gov-1 = 'reidcloud.aliyuncs.com',
    cn-beijing-nu16-b01 = 'reidcloud.aliyuncs.com',
    cn-chengdu = 'reidcloud.aliyuncs.com',
    cn-edge-1 = 'reidcloud.aliyuncs.com',
    cn-fujian = 'reidcloud.aliyuncs.com',
    cn-haidian-cm12-c01 = 'reidcloud.aliyuncs.com',
    cn-hangzhou = 'reidcloud.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'reidcloud.aliyuncs.com',
    cn-hangzhou-finance = 'reidcloud.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'reidcloud.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'reidcloud.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'reidcloud.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'reidcloud.aliyuncs.com',
    cn-hangzhou-test-306 = 'reidcloud.aliyuncs.com',
    cn-hongkong = 'reidcloud.aliyuncs.com',
    cn-hongkong-finance-pop = 'reidcloud.aliyuncs.com',
    cn-huhehaote = 'reidcloud.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'reidcloud.aliyuncs.com',
    cn-north-2-gov-1 = 'reidcloud.aliyuncs.com',
    cn-qingdao = 'reidcloud.aliyuncs.com',
    cn-qingdao-nebula = 'reidcloud.aliyuncs.com',
    cn-shanghai = 'reidcloud.cn-shanghai.aliyuncs.com',
    cn-shanghai-et15-b01 = 'reidcloud.aliyuncs.com',
    cn-shanghai-et2-b01 = 'reidcloud.aliyuncs.com',
    cn-shanghai-finance-1 = 'reidcloud.aliyuncs.com',
    cn-shanghai-inner = 'reidcloud.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'reidcloud.aliyuncs.com',
    cn-shenzhen = 'reidcloud.aliyuncs.com',
    cn-shenzhen-finance-1 = 'reidcloud.aliyuncs.com',
    cn-shenzhen-inner = 'reidcloud.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'reidcloud.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'reidcloud.aliyuncs.com',
    cn-wuhan = 'reidcloud.aliyuncs.com',
    cn-wulanchabu = 'reidcloud.aliyuncs.com',
    cn-yushanfang = 'reidcloud.aliyuncs.com',
    cn-zhangbei = 'reidcloud.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'reidcloud.aliyuncs.com',
    cn-zhangjiakou = 'reidcloud.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'reidcloud.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'reidcloud.aliyuncs.com',
    eu-central-1 = 'reidcloud.aliyuncs.com',
    eu-west-1 = 'reidcloud.aliyuncs.com',
    eu-west-1-oxs = 'reidcloud.aliyuncs.com',
    me-east-1 = 'reidcloud.aliyuncs.com',
    rus-west-1-pop = 'reidcloud.aliyuncs.com',
    us-east-1 = 'reidcloud.aliyuncs.com',
    us-west-1 = 'reidcloud.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('reid_cloud', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ListIpcStoreInfoRequest {
  ipcIds?: string(name='IpcIds'),
}

model ListIpcStoreInfoResponseBody = {
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  dynamicCode?: string(name='DynamicCode'),
  errorCode?: string(name='ErrorCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorMessage?: string(name='ErrorMessage'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  ipcInfoList?: [ 
    {
      id?: long(name='Id'),
      ip?: string(name='Ip'),
      storeId?: long(name='StoreId'),
      storeName?: string(name='StoreName'),
    }
  ](name='IpcInfoList'),
}

model ListIpcStoreInfoResponse = {
  headers: map[string]string(name='headers'),
  body: ListIpcStoreInfoResponseBody(name='body'),
}

async function listIpcStoreInfoWithOptions(request: ListIpcStoreInfoRequest, runtime: Util.RuntimeOptions): ListIpcStoreInfoResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListIpcStoreInfo', '2020-10-27', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listIpcStoreInfo(request: ListIpcStoreInfoRequest): ListIpcStoreInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpcStoreInfoWithOptions(request, runtime);
}

model ExtractFaceAttributeCRORequest {
  tenantId?: string(name='TenantId', description='租户Id'),
  sceneId?: string(name='SceneId', description='场景Id'),
  image?: string(name='Image', description='图片地址'),
  types?: [ string ](name='Types', description='请求属性列表'),
  monitor?: boolean(name='Monitor', description='是否监控场景'),
  version?: string(name='Version', description='版本'),
}

model ExtractFaceAttributeCROResponseBody = {
  success?: boolean(name='Success', description='是否成功'),
  errCode?: string(name='ErrCode', description='错误code	'),
  message?: string(name='Message', description='错误消息'),
  result?: [ 
    {
      gender?: {
        score?: float(name='Score'),
        value?: string(name='Value'),
      }(name='Gender', description='性别'),
      genderScore?: float(name='GenderScore', description='性别置信度'),
      headpose?: {
        pitchAngle?: float(name='PitchAngle', description='上下角度'),
        rollAngle?: float(name='RollAngle', description='旋转角度'),
        yawAngle?: float(name='YawAngle', description='左右角度'),
      }(name='Headpose', description='人脸角度'),
      facetype?: string(name='Facetype', description='人脸类型'),
      blur?: float(name='Blur', description='人脸模糊分'),
      age?: float(name='Age', description='年龄'),
      faceRect?: {
        top?: int32(name='Top', description='上'),
        left?: int32(name='Left', description='左'),
        width?: int32(name='Width', description='宽'),
        height?: int32(name='Height', description='高'),
      }(name='FaceRect', description='人脸矩形框的位置'),
      facequal?: float(name='Facequal', description='质量分'),
      facerank?: float(name='Facerank', description='质量分'),
      genderValue?: int32(name='GenderValue', description='性别值'),
      mask?: {
        score?: float(name='Score'),
        value?: string(name='Value'),
      }(name='Mask'),
    }
  ](name='Result', description='返回结果'),
  requestId?: string(name='RequestId'),
}

model ExtractFaceAttributeCROResponse = {
  headers: map[string]string(name='headers'),
  body: ExtractFaceAttributeCROResponseBody(name='body'),
}

async function extractFaceAttributeCROWithOptions(request: ExtractFaceAttributeCRORequest, runtime: Util.RuntimeOptions): ExtractFaceAttributeCROResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ExtractFaceAttributeCRO', '2020-10-27', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function extractFaceAttributeCRO(request: ExtractFaceAttributeCRORequest): ExtractFaceAttributeCROResponse {
  var runtime = new Util.RuntimeOptions{};
  return extractFaceAttributeCROWithOptions(request, runtime);
}

model CopyStoresRequest {
  sourceStoreId?: long(name='SourceStoreId'),
  copyWorking?: boolean(name='CopyWorking'),
  shadowStoreNum?: int32(name='ShadowStoreNum'),
  brandId?: long(name='BrandId'),
  storeName?: string(name='StoreName'),
}

model CopyStoresResponseBody = {
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  dynamicCode?: string(name='DynamicCode'),
  errorCode?: string(name='ErrorCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorMessage?: string(name='ErrorMessage'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  shadowStoreIds?: [ long ](name='ShadowStoreIds'),
}

model CopyStoresResponse = {
  headers: map[string]string(name='headers'),
  body: CopyStoresResponseBody(name='body'),
}

async function copyStoresWithOptions(request: CopyStoresRequest, runtime: Util.RuntimeOptions): CopyStoresResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CopyStores', '2020-10-27', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function copyStores(request: CopyStoresRequest): CopyStoresResponse {
  var runtime = new Util.RuntimeOptions{};
  return copyStoresWithOptions(request, runtime);
}

model GetAllStoreDataByTypeResponseBody = {
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  dynamicCode?: string(name='DynamicCode'),
  errorCode?: string(name='ErrorCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorMessage?: string(name='ErrorMessage'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  storeDataList?: [ 
    {
      storeId?: long(name='StoreId'),
      sqm?: float(name='Sqm'),
      rootLocationUid?: long(name='RootLocationUid'),
      rootLocationId?: long(name='RootLocationId'),
      storeName?: string(name='StoreName'),
      brandId?: long(name='BrandId'),
      brandName?: string(name='BrandName'),
      masterId?: long(name='MasterId'),
      sourceType?: string(name='SourceType'),
    }
  ](name='StoreDataList'),
}

model GetAllStoreDataByTypeResponse = {
  headers: map[string]string(name='headers'),
  body: GetAllStoreDataByTypeResponseBody(name='body'),
}

async function getAllStoreDataByTypeWithOptions(runtime: Util.RuntimeOptions): GetAllStoreDataByTypeResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('GetAllStoreDataByType', '2020-10-27', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAllStoreDataByType(): GetAllStoreDataByTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllStoreDataByTypeWithOptions(runtime);
}

model ExtractFaceFeatureCRORequest {
  tenantCode?: string(name='TenantCode', description='租户Id'),
  sceneId?: string(name='SceneId', description='场景Id'),
  image?: string(name='Image', description='image'),
  version?: string(name='Version', description='version'),
}

model ExtractFaceFeatureCROResponseBody = {
  success?: boolean(name='Success', description='是否成功'),
  errCode?: {
    errorMsg?: string(name='ErrorMsg', description='错误消息'),
    errorCode?: float(name='ErrorCode', description='错误码'),
    errorName?: string(name='ErrorName', description='错误名'),
  }(name='ErrCode', description='错误信息'),
  message?: string(name='Message', description='错误信息'),
  result?: [ float ](name='Result', description='数据对象'),
  requestId?: string(name='RequestId'),
}

model ExtractFaceFeatureCROResponse = {
  headers: map[string]string(name='headers'),
  body: ExtractFaceFeatureCROResponseBody(name='body'),
}

async function extractFaceFeatureCROWithOptions(request: ExtractFaceFeatureCRORequest, runtime: Util.RuntimeOptions): ExtractFaceFeatureCROResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ExtractFaceFeatureCRO', '2020-10-27', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function extractFaceFeatureCRO(request: ExtractFaceFeatureCRORequest): ExtractFaceFeatureCROResponse {
  var runtime = new Util.RuntimeOptions{};
  return extractFaceFeatureCROWithOptions(request, runtime);
}

model GetEmapIpcDataListByStoreIdRequest {
  storeId?: long(name='StoreId'),
  searchTimestamp?: long(name='SearchTimestamp'),
}

model GetEmapIpcDataListByStoreIdResponseBody = {
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  dynamicCode?: string(name='DynamicCode'),
  errorCode?: string(name='ErrorCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorMessage?: string(name='ErrorMessage'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  emapIpcDataList?: [ 
    {
      emapIpcId?: string(name='EmapIpcId'),
      emapIpcUid?: long(name='EmapIpcUid'),
      emapUid?: long(name='EmapUid'),
      ipcId?: long(name='IpcId'),
      storeId?: long(name='StoreId'),
      status?: int32(name='Status'),
      h?: string(name='H'),
      imgWidth?: int32(name='ImgWidth'),
      imgHeight?: int32(name='ImgHeight'),
      types?: [ string ](name='Types'),
      name?: string(name='Name'),
      floor?: string(name='Floor'),
      captureType?: string(name='CaptureType'),
      association?: [ long ](name='Association'),
    }
  ](name='EmapIpcDataList'),
}

model GetEmapIpcDataListByStoreIdResponse = {
  headers: map[string]string(name='headers'),
  body: GetEmapIpcDataListByStoreIdResponseBody(name='body'),
}

async function getEmapIpcDataListByStoreIdWithOptions(request: GetEmapIpcDataListByStoreIdRequest, runtime: Util.RuntimeOptions): GetEmapIpcDataListByStoreIdResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetEmapIpcDataListByStoreId', '2020-10-27', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getEmapIpcDataListByStoreId(request: GetEmapIpcDataListByStoreIdRequest): GetEmapIpcDataListByStoreIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getEmapIpcDataListByStoreIdWithOptions(request, runtime);
}

